package com.ScoresSystem.service.Impl;

import com.ScoresSystem.mapper.TeacherMapper;
import com.ScoresSystem.pojo.Teacher;
import com.ScoresSystem.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImpl implements TeacherService {

    @Autowired
    TeacherMapper teacherMapper;

    @Override
    public List<Teacher> findAllTeachers() {
        return teacherMapper.findAllTeachers();
    }

    @Override
    public Teacher login(String tname, String tpassword) {
        return teacherMapper.login(tname,tpassword);
    }

    @Override
    public Teacher findTeacher(String nowUserName, String oldPassword) {
        return teacherMapper.findTeacher(nowUserName,oldPassword);
    }

    @Override
    public int updatePassword(String nowUserName, String newPassword) {
        return teacherMapper.updatePassword(nowUserName,newPassword);
    }
}
